/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "cex_fisico_regional")
@NamedQueries({
    @NamedQuery(name = "CexFisicoRegional.findAll", query = "SELECT c FROM CexFisicoRegional c")})
public class CexFisicoRegional implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cef_id")
    private Integer cefId;
    @Basic(optional = false)
    @Column(name = "cef_nombre")
    private String cefNombre;
    @Column(name = "cef_con_externa")
    private Boolean cefConExterna;
    @Column(name = "cef_emergencia")
    private Boolean cefEmergencia;
    @OneToMany(mappedBy = "cexFisicoRegional", fetch = FetchType.LAZY)
    private List<EmeFisicoAtencion> emeFisicoAtencionList;
    @OneToMany(mappedBy = "cexFisicoRegional", fetch = FetchType.LAZY)
    private List<CexFisicoRegional> cexFisicoRegionalList;
    @JoinColumn(name = "cef_cef_id", referencedColumnName = "cef_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private CexFisicoRegional cexFisicoRegional;
    @OneToMany(mappedBy = "cexFisicoRegional", fetch = FetchType.LAZY)
    private List<CexExamenFisico> cexExamenFisicoList;

    
    

    public CexFisicoRegional() {
    }

    public CexFisicoRegional(Integer cefId) {
        this.cefId = cefId;
    }

    public CexFisicoRegional(Integer cefId, String cefNombre) {
        this.cefId = cefId;
        this.cefNombre = cefNombre;
    }

    public Integer getCefId() {
        return cefId;
    }

    public void setCefId(Integer cefId) {
        this.cefId = cefId;
    }

    public String getCefNombre() {
        return cefNombre;
    }

    public void setCefNombre(String cefNombre) {
        this.cefNombre = cefNombre;
    }

    public Boolean getCefConExterna() {
        return cefConExterna;
    }

    public void setCefConExterna(Boolean cefConExterna) {
        this.cefConExterna = cefConExterna;
    }

    public Boolean getCefEmergencia() {
        return cefEmergencia;
    }

    public void setCefEmergencia(Boolean cefEmergencia) {
        this.cefEmergencia = cefEmergencia;
    }

    public List<EmeFisicoAtencion> getEmeFisicoAtencionList() {
        return emeFisicoAtencionList;
    }

    public void setEmeFisicoAtencionList(List<EmeFisicoAtencion> emeFisicoAtencionList) {
        this.emeFisicoAtencionList = emeFisicoAtencionList;
    }

    public List<CexFisicoRegional> getCexFisicoRegionalList() {
        return cexFisicoRegionalList;
    }

    public void setCexFisicoRegionalList(List<CexFisicoRegional> cexFisicoRegionalList) {
        this.cexFisicoRegionalList = cexFisicoRegionalList;
    }

    public CexFisicoRegional getCexFisicoRegional() {
        return cexFisicoRegional;
    }

    public void setCexFisicoRegional(CexFisicoRegional cexFisicoRegional) {
        this.cexFisicoRegional = cexFisicoRegional;
    }

    public List<CexExamenFisico> getCexExamenFisicoList() {
        return cexExamenFisicoList;
    }

    public void setCexExamenFisicoList(List<CexExamenFisico> cexExamenFisicoList) {
        this.cexExamenFisicoList = cexExamenFisicoList;
    }

       
    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cefId != null ? cefId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CexFisicoRegional)) {
            return false;
        }
        CexFisicoRegional other = (CexFisicoRegional) object;
        if ((this.cefId == null && other.cefId != null) || (this.cefId != null && !this.cefId.equals(other.cefId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newpackage.CexFisicoRegional[ cefId=" + cefId + " ]";
    }
    
}
